<?php include('scripts.php'); ?>

<script type="text/javascript" language="javascript">
$(function() {
    $("#sponsorTree").treeview({
        url: "/member/manipulateSponsorTree"
    });
});
</script>

<div style="padding: 10px; top: 30px; width: 98%">
<div class="portlet">
    <div class="portlet-header"><?php echo __('Sponsor Tree') ?></div>
    <div class="portlet-content">

<p class='bold'><strong><?php echo __('Genealogy for your Shareholder ID').": ".$distinfo->getDistributorCode(); ?></strong></p>
<div class='genealogy'>

<ul id="sponsorTree" style="background-color: #ffffff;">
    <?php
        $className = "";

        if ($hasChild) {
            $className = "class='hasChildren'";
        }
    ?>
    <li id="<?php echo $distinfo->getDistributorId();?>" <?php echo $className;?>>
        <span><?php echo $distinfo->getDistributorCode()." ".$distinfo->getNickName()." Joined ".date('Y-m-d', strtotime($distinfo->getActiveDatetime()));?></span>
        <?php
        if ($hasChild) {
        ?>
        <ul>
            <li><span class="placeholder">&nbsp;</span></li>
        </ul>
        <?php } ?>
    </li>
</ul>

</div>

</div></div></div>